package com.itlong.cloud.user.sdk;

import com.itlong.cloud.POJO.DTO.sdk.CloudTalkSDKAppUserLoginDTO;
import com.itlong.cloud.POJO.PO.PropertyUserInfoPO;
import com.itlong.cloud.POJO.VO.sdk.CloudTalkSDKAppDemoLoginVO;
import com.itlong.cloud.POJO.VO.sdk.CloudTalkSDKAppUserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.io.UnsupportedEncodingException;

/**
 * <desc>
 *      云对讲SDK app用户业务处理暴露接口
 * </desc>
 *
 * @createDate 2018/05/11
 */
@FeignClient(name = "user-service")
public interface ICloudTalkSDKAppUserServiceClient {
    /**
     * <desc>
     *      云对讲SDK认证
     * </desc>
     *
     * @param dto
     * @return
     * @author Jiaqi.X
     * @createDate 2018/05/11
     */
    @RequestMapping(path = "/cloudTalkSdk/app/authentication",method = RequestMethod.POST)
    CloudTalkSDKAppUserVO authentication(CloudTalkSDKAppUserLoginDTO dto) throws UnsupportedEncodingException;

    /**
     * <desc>
     *      云对讲SDK 登出
     * </desc>
     *
     * @param token
     * @author Jiaqi.X
     * @createDate 2018/05/14
     */
    @RequestMapping(path = "/cloudTalkSdk/app/logout",method = RequestMethod.POST)
    void logout(String token);

    /**
     * <desc>
     *      从缓存中获取用户信息
     * </desc>
     *
     * @param token 用户token
     * @return
     * @author Jiaqi.X
     * @createDate 2017/10/12
     */
    @RequestMapping(path = "/cloudTalkSdk/app/retrieve",method = RequestMethod.POST)
    CloudTalkSDKAppUserVO retrieve(String token);

    /**
     * <desc>
     *      通过手机号获取app用户id
     * </desc>
     *
     * @param phoneNum
     * @return
     * @author Jiaqi.X
     * @createDate 2018/05/14
     */
    @RequestMapping(path = "/cloudTalkSdk/app/getUserIdByPhoneNum",method = RequestMethod.POST)
    String getUserIdByPhoneNum(String phoneNum);

    /**
     * <desc>
     *      demo登录
     * <desc/>
     *
     * @return 云对讲SDK APP demo登录VO对象
     * @author wangzhi
     * @createDate 2018/11/21
     */
    @PostMapping(path = "/cloudTalkSdk/app/cloudTalkLogin")
    CloudTalkSDKAppDemoLoginVO cloudTalkLogin(@RequestParam("phoneNo") String phoneNo, @RequestParam("pswd") String pswd) throws Exception;

    /**
     * <desc>
     *      SDK开发者认证
     * <desc/>
     *
     * @return propertyUserInfoPO
     * @return robotId 机器人编号
     * @author Qiang.S
     * @createDate 2019/09/16
     */
    @PostMapping(path = "/cloud/base/developerLogin")
    String developerLogin(@RequestBody PropertyUserInfoPO propertyUserInfoPO,@RequestParam(value = "robotId", required = false) String robotId) throws Exception;

    /**
     * <desc>
     *      从缓存中获取开发者信息
     * </desc>
     *
     * @param token 用户token
     * @return
     * @author Qiang.S
     * @createDate 2019/09/16
     */
    @RequestMapping(path = "/cloud/base/developerRetrieve",method = RequestMethod.POST)
    PropertyUserInfoPO developerRetrieve(@RequestParam("token") String token) throws Exception;

    /**
     * <desc>
     *      机器人调试工具开发者认证
     * <desc/>
     *
     * @return propertyUserInfoPO
     * @return robotId 机器人编号
     * @author Qiang.S
     * @createDate 2019/09/16
     */
    @RequestMapping(path = "/cloud/base/robotGoDeveloperLogin",method = RequestMethod.POST)
    String robotGoDeveloperLogin(@RequestBody PropertyUserInfoPO propertyUserInfoPO,@RequestParam(value = "robotId", required = false) String robotId) throws Exception;

    /**
     *<desc>
     * 设置消息回调的url地址
     *</desc>
     *
     * @Author  chengshican
     * @Date   2020-11-19 19:27
     * @Param
     * @Return
     * @Exception
     *
     */
    @RequestMapping(path = "/cloud/base/updateUserProjectByUserId",method = RequestMethod.POST)
    Integer updateUserProjectByUserId(@RequestParam("updateMessageCallbackRrl") String updateMessageCallbackRrl,
                                      @RequestParam("projectId") String projectId,
                                      @RequestParam("userId") String userId) throws Exception ;
}
